import Mock from 'mockjs'

const order = Mock.mock({
  'items|10': [{
    'createTime': '@now',
    'createUserId': '@id',
    'estimateParamId': '@id',
    'isValid': '',
    'paramCode': '@title',
    'paramName': '@cname',
    'remark': '@word',
    'score|1-60': 1,
    'status|1': [0, 1],
    'updateTime': '@now',
    'updateUserId': '@id'
  }]
})
const remark = Mock.mock({
  'items|10': [{
    'remark': '@word',
    'resultList': [
      {
        'createTime': '@now',
        'createUserId': '@id',
        'isValid': '',
        'paramCode': '@title',
        'paramName': '@cname',
        'point|1-100': 1,
        'score|1-100': 1,
        'updateTime': '@now',
        'updateUserId': '@id'
      }
    ]
  }]
})
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 30,
  totalPage: 1
}
const dictMap = {
  workType: {
    1: 'eee',
    2: 'rrr'
  },
  taskMode: {
    1: 'ttt',
    2: 'yyy'
  },
  orderStatus: {
    1: '待接单',
    2: '待开工',
    3: '待完工',
    4: '待确认'
  }
}
export default [
  // 电工个人订单列表【网页用】
  {
    url: '/task/estimate/batchModifyEstimateParam',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }, {
    url: '/task/estimate/estimateTask',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }, {
    url: '/task/estimate/listEstimateParam',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }, {
    url: '/task/estimate/listUserEstimateInfo',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...remark,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }
]
